{{- $postCSSOptions := dict "config" "postcss.config.js" }}
{{- $outputStyle := "expanded" }}
{{- if hugo.IsProduction }}{{ $outputStyle = "compressed" }}{{ end }}
{{- $options := dict
  "transpiler" (default "libsass" site.Params.sass_transpiler)
  "targetPath" "assets/main/bundle.min.css"
  "outputStyle" $outputStyle
  "includePaths" (slice "node_modules")
}}
{{- $config := resources.Get "main/scss/_config.scss" | resources.ExecuteAsTemplate "main/scss/_config.scss" . }}
{{- $main := resources.Get "main/scss/index.scss" }}
{{- $styles := slice $config $main }}
{{- $styles := $styles | resources.Concat "main/scss/main.css" | toCSS $options | css.PostCSS $postCSSOptions | fingerprint }}
{{- if hugo.IsProduction }}{{ $styles = $styles | resources.PostProcess }}{{ end }}
<link data-precache rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous">
{{- partial "assets/main/custom" . }}
